/**	
* @namespace
* Coordinates the general app framework config options with config partners that use them to properly
* startup when the page is first loaded.
* @Depends ksg.App.js
* @meta-type static class
*/
ksg.App.configMgr = {
	/**
	* The array of registered config parters, which is populated by calling the
	* registerConfigParner method.
	*/
	_configPartners: [],
	
	/**
	* If a feature needs to have options passed to it in order to properly startup when a page is first loaded,
	* it should register as a config patner.
	* <p>When the startup process calls the ksg.App.configMgr.init method, the config partners are called
	* and given the options from the page.</p>
	* @param {ksg.config.IConfigPartner} partner An object that implements the IConfigPartner interface.
	*/
	registerConfigPartner: function(partner) {
		this._configPartners.push(partner);
	},
	
	/**
	* Call during page startup to properly handle startup of various items, such as config partners.
	* <p>This is typically called by the ksgSetupUI jQuery plugin that initializes everything on the page.
	* @param {Object} options The options passed in from the page startup code.
	*/
	init: function(options) {
		for(var i in this._configPartners) {
			try {
				var results = this._configPartners[i](options);
				//TODO check for partner failure.
			}
			catch(e) {
				//TODO do something about exception during partner config init.
			}
		}
	}
};
